﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Ord3a02
    {
        private int? _taxcode;
		private string _taxname;
		private double _taxpct;
		private double _agio;
		private string _plistid;
		
        /// <summary>
        /// 费用代码
        /// </summary>
		public int? Taxcode
		{
			get { return _taxcode;	 }
			set { _taxcode=value;	}
		}
        /// <summary>
        /// 费用名称
        /// </summary>
		public string Taxname
		{
			get { return _taxname;	 }
			set { _taxname=value;	}
		}
        /// <summary>
        /// 费率
        /// </summary>
		public double Taxpct
		{
			get { return _taxpct;	 }
			set { _taxpct=value;	}
		}
        /// <summary>
        /// 折扣
        /// </summary>
		public double Agio
		{
			get { return _agio;	 }
			set { _agio=value;	}
		}
        /// <summary>
        /// 订单标识
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
		
		public static List<Ord3a02> GetOrd3a02ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Ord3a02> list = new List<Ord3a02>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Ord3a02 model = GetOrd3a02ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Ord3a02 GetOrd3a02ByDataRow(DataRow dr)
		{
			Ord3a02 model = new Ord3a02(); //实例化Ord3a02
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("taxcode")&&!(dr["taxcode"] is System.DBNull))  
				model.Taxcode = ( int)dr["taxcode"];
			if (dcc.Contains("taxname")&&!(dr["taxname"] is System.DBNull))  
				model.Taxname = ( string)dr["taxname"];
			if (dcc.Contains("taxpct")&&!(dr["taxpct"] is System.DBNull))  
				model.Taxpct = Convert.ToDouble(dr["taxpct"]);
			if (dcc.Contains("agio")&&!(dr["agio"] is System.DBNull))  
				model.Agio = Convert.ToDouble(dr["agio"]);
			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			
			return model;
		}
    }
}
